#extension GL_ARB_shading_language_420pack : enable
layout(binding=0)uniform sampler2D sharp_texture;
layout(binding=1)uniform sampler2D blurred_texture;
in vec2 TexCoords;
out vec4 FragmentColor;


void main(void) {
	vec2 NewTexCoords = ((TexCoords) + 1.0) * 0.5;
	//vec4 DepthSample = texture2D(fbo_texture, NewTexCoords);
	
	
	//vec3 TextureSample;
	//int size = 5;
	//TextureSample = blur(NewTexCoords, size);//texture2D(fbo_texture, NewTexCoords);
    
	vec4 BlurredSample = texture2D(blurred_texture, NewTexCoords);
	vec4 SharpSample = texture2D(sharp_texture, NewTexCoords);
	float blend = clamp(abs(SharpSample.a) * 0.5, 0.0, 1.0);
	vec3 BlendedSample = mix(SharpSample.xyz, BlurredSample.xyz, blend);
	FragmentColor = vec4(BlendedSample.xyz, 1.0);	

}

